// index.js
// 获取应用实例
const app = getApp()

Page({
  /**
   * 页面的初始数据
   */
  data: {
    info: "hello world",
    imgSrc: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg0.utuku.imgcdc.com%2F650x0%2Fent%2F20210915%2Fabe3d2fd-4cd4-4b9e-a94b-a099f9b20b09.jpg&refer=http%3A%2F%2Fimg0.utuku.imgcdc.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1650111405&t=04af2a8f1dfd75d8f70a471b9446adac",
    randomNum1: Math.random() * 10,
    randomNum2: Math.random().toFixed(2),
    count: 0,
    msg: "你好, ",
    type: 1,
    flag: true
  },
  //定义按钮的事件处理函数
  btnTapHandler(e) {
    console.log(e);
  },
  // +1 按钮的点击事件处理函数
  CountChange() {
    this.setData({
      count: this.data.count + 1
    })
  },
  btnTap2(e) {
    this.setData({
      count: this.data.count + e.target.dataset.info
    })
  },
  //input 输入框的事件处理函数
  inputHandler(e) {
    this.setData({
      msg: e.detail.value
    })
  }
})